/**
 * CRC GENERIC LIBRARY.
 *
 * Copyright (c) 2016 Zaltora (https://github.com/Zaltora)
 *
 * BSD Licensed as described in the file LICENSE
 */

#ifndef CRC_LIB_CRC_24_LOOKUP_TABLE_H_
#define CRC_LIB_CRC_24_LOOKUP_TABLE_H_

//The CHECK value is the result of making the checksum of the char[] = "123456789";
//List of preset array available and crc config details
/*
Algorithm              Check      Poly      Init    RefIn   RefOut    XorOut
CRC-24                0x21CF02  0x864CFB  0xB704CE  false   false    0x000000
CRC-24/flexray-a      0x7979BD  0x5D6DCB  0xFEDCBA  false   false    0x000000
CRC-24/flexray-b      0x1F23B8  0x5D6DCB  0xABCDEF  false   false    0x000000
 */

/*
 *  poly=0x864CFB init=0xB704CE direct=true refin=false refout=false xorout=0x000000 check=0x21CF02
 */
static const crc_32 crc_24_tab[256]  = {
        0x00000000, 0x00864CFB, 0x008AD50D, 0x000C99F6, 0x0093E6E1, 0x0015AA1A, 0x001933EC, 0x009F7F17,
        0x00A18139, 0x0027CDC2, 0x002B5434, 0x00AD18CF, 0x003267D8, 0x00B42B23, 0x00B8B2D5, 0x003EFE2E,
        0x00C54E89, 0x00430272, 0x004F9B84, 0x00C9D77F, 0x0056A868, 0x00D0E493, 0x00DC7D65, 0x005A319E,
        0x0064CFB0, 0x00E2834B, 0x00EE1ABD, 0x00685646, 0x00F72951, 0x007165AA, 0x007DFC5C, 0x00FBB0A7,
        0x000CD1E9, 0x008A9D12, 0x008604E4, 0x0000481F, 0x009F3708, 0x00197BF3, 0x0015E205, 0x0093AEFE,
        0x00AD50D0, 0x002B1C2B, 0x002785DD, 0x00A1C926, 0x003EB631, 0x00B8FACA, 0x00B4633C, 0x00322FC7,
        0x00C99F60, 0x004FD39B, 0x00434A6D, 0x00C50696, 0x005A7981, 0x00DC357A, 0x00D0AC8C, 0x0056E077,
        0x00681E59, 0x00EE52A2, 0x00E2CB54, 0x006487AF, 0x00FBF8B8, 0x007DB443, 0x00712DB5, 0x00F7614E,
        0x0019A3D2, 0x009FEF29, 0x009376DF, 0x00153A24, 0x008A4533, 0x000C09C8, 0x0000903E, 0x0086DCC5,
        0x00B822EB, 0x003E6E10, 0x0032F7E6, 0x00B4BB1D, 0x002BC40A, 0x00AD88F1, 0x00A11107, 0x00275DFC,
        0x00DCED5B, 0x005AA1A0, 0x00563856, 0x00D074AD, 0x004F0BBA, 0x00C94741, 0x00C5DEB7, 0x0043924C,
        0x007D6C62, 0x00FB2099, 0x00F7B96F, 0x0071F594, 0x00EE8A83, 0x0068C678, 0x00645F8E, 0x00E21375,
        0x0015723B, 0x00933EC0, 0x009FA736, 0x0019EBCD, 0x008694DA, 0x0000D821, 0x000C41D7, 0x008A0D2C,
        0x00B4F302, 0x0032BFF9, 0x003E260F, 0x00B86AF4, 0x002715E3, 0x00A15918, 0x00ADC0EE, 0x002B8C15,
        0x00D03CB2, 0x00567049, 0x005AE9BF, 0x00DCA544, 0x0043DA53, 0x00C596A8, 0x00C90F5E, 0x004F43A5,
        0x0071BD8B, 0x00F7F170, 0x00FB6886, 0x007D247D, 0x00E25B6A, 0x00641791, 0x00688E67, 0x00EEC29C,
        0x003347A4, 0x00B50B5F, 0x00B992A9, 0x003FDE52, 0x00A0A145, 0x0026EDBE, 0x002A7448, 0x00AC38B3,
        0x0092C69D, 0x00148A66, 0x00181390, 0x009E5F6B, 0x0001207C, 0x00876C87, 0x008BF571, 0x000DB98A,
        0x00F6092D, 0x007045D6, 0x007CDC20, 0x00FA90DB, 0x0065EFCC, 0x00E3A337, 0x00EF3AC1, 0x0069763A,
        0x00578814, 0x00D1C4EF, 0x00DD5D19, 0x005B11E2, 0x00C46EF5, 0x0042220E, 0x004EBBF8, 0x00C8F703,
        0x003F964D, 0x00B9DAB6, 0x00B54340, 0x00330FBB, 0x00AC70AC, 0x002A3C57, 0x0026A5A1, 0x00A0E95A,
        0x009E1774, 0x00185B8F, 0x0014C279, 0x00928E82, 0x000DF195, 0x008BBD6E, 0x00872498, 0x00016863,
        0x00FAD8C4, 0x007C943F, 0x00700DC9, 0x00F64132, 0x00693E25, 0x00EF72DE, 0x00E3EB28, 0x0065A7D3,
        0x005B59FD, 0x00DD1506, 0x00D18CF0, 0x0057C00B, 0x00C8BF1C, 0x004EF3E7, 0x00426A11, 0x00C426EA,
        0x002AE476, 0x00ACA88D, 0x00A0317B, 0x00267D80, 0x00B90297, 0x003F4E6C, 0x0033D79A, 0x00B59B61,
        0x008B654F, 0x000D29B4, 0x0001B042, 0x0087FCB9, 0x001883AE, 0x009ECF55, 0x009256A3, 0x00141A58,
        0x00EFAAFF, 0x0069E604, 0x00657FF2, 0x00E33309, 0x007C4C1E, 0x00FA00E5, 0x00F69913, 0x0070D5E8,
        0x004E2BC6, 0x00C8673D, 0x00C4FECB, 0x0042B230, 0x00DDCD27, 0x005B81DC, 0x0057182A, 0x00D154D1,
        0x0026359F, 0x00A07964, 0x00ACE092, 0x002AAC69, 0x00B5D37E, 0x00339F85, 0x003F0673, 0x00B94A88,
        0x0087B4A6, 0x0001F85D, 0x000D61AB, 0x008B2D50, 0x00145247, 0x00921EBC, 0x009E874A, 0x0018CBB1,
        0x00E37B16, 0x006537ED, 0x0069AE1B, 0x00EFE2E0, 0x00709DF7, 0x00F6D10C, 0x00FA48FA, 0x007C0401,
        0x0042FA2F, 0x00C4B6D4, 0x00C82F22, 0x004E63D9, 0x00D11CCE, 0x00575035, 0x005BC9C3, 0x00DD8538,
};


/*
 *  poly=0x5D6DCB init=0xFEDCBA direct=true refin=false refout=false xorout=0x000000 check=0x7979BD
 */
static const crc_32 crc_24_tab_FLEXRAYA[256]  = {
        0x00000000, 0x005D6DCB, 0x00BADB96, 0x00E7B65D, 0x0028DAE7, 0x0075B72C, 0x00920171, 0x00CF6CBA,
        0x0051B5CE, 0x000CD805, 0x00EB6E58, 0x00B60393, 0x00796F29, 0x002402E2, 0x00C3B4BF, 0x009ED974,
        0x00A36B9C, 0x00FE0657, 0x0019B00A, 0x0044DDC1, 0x008BB17B, 0x00D6DCB0, 0x00316AED, 0x006C0726,
        0x00F2DE52, 0x00AFB399, 0x004805C4, 0x0015680F, 0x00DA04B5, 0x0087697E, 0x0060DF23, 0x003DB2E8,
        0x001BBAF3, 0x0046D738, 0x00A16165, 0x00FC0CAE, 0x00336014, 0x006E0DDF, 0x0089BB82, 0x00D4D649,
        0x004A0F3D, 0x001762F6, 0x00F0D4AB, 0x00ADB960, 0x0062D5DA, 0x003FB811, 0x00D80E4C, 0x00856387,
        0x00B8D16F, 0x00E5BCA4, 0x00020AF9, 0x005F6732, 0x00900B88, 0x00CD6643, 0x002AD01E, 0x0077BDD5,
        0x00E964A1, 0x00B4096A, 0x0053BF37, 0x000ED2FC, 0x00C1BE46, 0x009CD38D, 0x007B65D0, 0x0026081B,
        0x003775E6, 0x006A182D, 0x008DAE70, 0x00D0C3BB, 0x001FAF01, 0x0042C2CA, 0x00A57497, 0x00F8195C,
        0x0066C028, 0x003BADE3, 0x00DC1BBE, 0x00817675, 0x004E1ACF, 0x00137704, 0x00F4C159, 0x00A9AC92,
        0x00941E7A, 0x00C973B1, 0x002EC5EC, 0x0073A827, 0x00BCC49D, 0x00E1A956, 0x00061F0B, 0x005B72C0,
        0x00C5ABB4, 0x0098C67F, 0x007F7022, 0x00221DE9, 0x00ED7153, 0x00B01C98, 0x0057AAC5, 0x000AC70E,
        0x002CCF15, 0x0071A2DE, 0x00961483, 0x00CB7948, 0x000415F2, 0x00597839, 0x00BECE64, 0x00E3A3AF,
        0x007D7ADB, 0x00201710, 0x00C7A14D, 0x009ACC86, 0x0055A03C, 0x0008CDF7, 0x00EF7BAA, 0x00B21661,
        0x008FA489, 0x00D2C942, 0x00357F1F, 0x006812D4, 0x00A77E6E, 0x00FA13A5, 0x001DA5F8, 0x0040C833,
        0x00DE1147, 0x00837C8C, 0x0064CAD1, 0x0039A71A, 0x00F6CBA0, 0x00ABA66B, 0x004C1036, 0x00117DFD,
        0x006EEBCC, 0x00338607, 0x00D4305A, 0x00895D91, 0x0046312B, 0x001B5CE0, 0x00FCEABD, 0x00A18776,
        0x003F5E02, 0x006233C9, 0x00858594, 0x00D8E85F, 0x001784E5, 0x004AE92E, 0x00AD5F73, 0x00F032B8,
        0x00CD8050, 0x0090ED9B, 0x00775BC6, 0x002A360D, 0x00E55AB7, 0x00B8377C, 0x005F8121, 0x0002ECEA,
        0x009C359E, 0x00C15855, 0x0026EE08, 0x007B83C3, 0x00B4EF79, 0x00E982B2, 0x000E34EF, 0x00535924,
        0x0075513F, 0x00283CF4, 0x00CF8AA9, 0x0092E762, 0x005D8BD8, 0x0000E613, 0x00E7504E, 0x00BA3D85,
        0x0024E4F1, 0x0079893A, 0x009E3F67, 0x00C352AC, 0x000C3E16, 0x005153DD, 0x00B6E580, 0x00EB884B,
        0x00D63AA3, 0x008B5768, 0x006CE135, 0x00318CFE, 0x00FEE044, 0x00A38D8F, 0x00443BD2, 0x00195619,
        0x00878F6D, 0x00DAE2A6, 0x003D54FB, 0x00603930, 0x00AF558A, 0x00F23841, 0x00158E1C, 0x0048E3D7,
        0x00599E2A, 0x0004F3E1, 0x00E345BC, 0x00BE2877, 0x007144CD, 0x002C2906, 0x00CB9F5B, 0x0096F290,
        0x00082BE4, 0x0055462F, 0x00B2F072, 0x00EF9DB9, 0x0020F103, 0x007D9CC8, 0x009A2A95, 0x00C7475E,
        0x00FAF5B6, 0x00A7987D, 0x00402E20, 0x001D43EB, 0x00D22F51, 0x008F429A, 0x0068F4C7, 0x0035990C,
        0x00AB4078, 0x00F62DB3, 0x00119BEE, 0x004CF625, 0x00839A9F, 0x00DEF754, 0x00394109, 0x00642CC2,
        0x004224D9, 0x001F4912, 0x00F8FF4F, 0x00A59284, 0x006AFE3E, 0x003793F5, 0x00D025A8, 0x008D4863,
        0x00139117, 0x004EFCDC, 0x00A94A81, 0x00F4274A, 0x003B4BF0, 0x0066263B, 0x00819066, 0x00DCFDAD,
        0x00E14F45, 0x00BC228E, 0x005B94D3, 0x0006F918, 0x00C995A2, 0x0094F869, 0x00734E34, 0x002E23FF,
        0x00B0FA8B, 0x00ED9740, 0x000A211D, 0x00574CD6, 0x0098206C, 0x00C54DA7, 0x0022FBFA, 0x007F9631,
};


/*
 *  poly=0x5D6DCB init=0xABCDEF direct=true refin=false refout=false xorout=0x000000 check=0x1F23B8
 */
#define crc_24_tab_FLEXRAYB crc_24_tab_FLEXRAYA

#endif /* CRC_LIB_CRC_24_LOOKUP_TABLE_H_ */
